<template>
    <div class="container">
        <h1 >无权访问,{{countDown}}秒后将返回主界面</h1>
   </div> 

</template>

<script setup lang="ts">
    import router from '@/router';
    import { onMounted,onUnmounted,ref } from 'vue';
    const countDown=ref<number>(3)
    let timer;
    onMounted(()=>{
        timer=setInterval(()=>{
          if(countDown.value<=0){
            router.push("/home")
          }
          countDown.value--;
        },1000)
    })
    onUnmounted(()=>{clearInterval(timer)})

</script>


<style scoped>
.container {

    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}
</style>